Defining functions and packages

# 1. Source functions ----

source("functions/graphical_par.R")
source("functions/theme_graph.R")
source("functions/pred_vbgf.R")

# 2. Required packages ----

library(tidyverse)
library(kableExtra)
library(formattable)
library(readxl)
library(plotly)
library(rfishbase)

# 3. Set theme_graph() as the default ggplot theme ----

theme_set(theme_graph())

# 4. Load data ----

data_complete <- read.csv("./../data/02_back-calculated-size-at-age_morat-et-al.csv")

1. Data exploration

1.1 Tables

1.1.1 Data with back-calc.

data_complete %>% 
  filter(!is.na(Li_sp_m)) %>% 
  summarize_at(vars("ID", "Species", "Family"), n_distinct, na.rm = TRUE) %>% 
  bind_rows(data_complete %>%
              summarize_at(vars("ID", "Species", "Family"), n_distinct, na.rm = TRUE), .) %>% 
  mutate(Type = c("All data", "Back-calculated"), .before = 1) %>% 
  kable(., 
        col.names = c("", "Individual", "Species", "Family"), 
        caption = "Table 1. Comparison of numbers of individuals, species and family for the overall dataset and for back-calculated data") %>% 
  kable_styling(bootstrap_options = c("striped", "hover"))
Table 1. Comparison of numbers of individuals, species and family for the overall dataset and for back-calculated data
Individual Species Family
All data 855 51 16
Back-calculated 710 45 16

1.1.2 Individual by species

data_complete %>%
  group_by(Species) %>% 
  summarise(n = length(unique(ID)),
        min_lencap = round(min(Lcpt, na.rm = TRUE), 0),
        max_lencap = round(max(Lcpt, na.rm = TRUE), 0),
        max_age = max(Agei, na.rm = TRUE)) %>% 
  kable(., 
        col.names = c("Species", "n", "Min length (TL, mm)", "Max length (TL, mm)", "Age max (years)"),
        caption = "Table 2. Number of individuals, minimum and maximum total length (mm) and maximum age, by species") %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  column_spec(1, italic = T)
Table 2. Number of individuals, minimum and maximum total length (mm) and maximum age, by species
Species n Min length (TL, mm) Max length (TL, mm) Age max (years)
Abudefduf sexfasciatus 16 51 172 13
Acanthurus achilles 17 130 246 27
Acanthurus lineatus 8 123 362 23
Acanthurus nigricans 8 150 210 9
Acanthurus pyroferus 18 51 230 19
Acanthurus triostegus 18 147 194 12
Balistapus undulatus 22 41 283 18
Caranx melampygus 7 368 712 15
Centropyge bispinosa 9 28 80 11
Centropyge flavissima 28 47 150 27
Cephalopholis argus 41 120 450 21
Cephalopholis urodeta 8 150 214 17
Chaetodon citrinellus 13 55 101 6
Chaetodon ornatissimus 10 122 175 10
Cheilinus chlorourus 8 96 299 6
Chlorurus spilurus 34 164 344 16
Chromis iomelas 20 39 61 5
Chromis viridis 6 115 148 9
Ctenochaetus marginatus 15 99 270 13
Ctenochaetus striatus 26 153 218 17
Dascyllus aruanus 20 51 71 7
Dascyllus flavicaudus 8 89 104 13
Epibulus insidiator 17 157 350 16
Epinephelus fasciatus 10 123 256 13
Epinephelus hexagonatus 16 139 268 14
Epinephelus merra 46 108 261 17
Epinephelus polyphekadion 14 252 514 20
Gnathodentex aureolineatus 8 197 255 17
Gymnosarda unicolor 4 499 985 7
Halichoeres trimaculatus 13 64 186 5
Lutjanus fulvus 12 195 289 21
Lutjanus gibbus 17 113 155 1
Lutjanus kasmira 37 70 326 30
Monotaxis grandoculis 9 200 505 20
Mulloidichthys flavolineatus 14 257 311 6
Myripristis berndti 30 147 279 24
Naso lituratus 17 228 432 10
Naso unicornis 4 488 613 17
Odonus niger 18 176 350 16
Ostorhinchus angustatus 15 46 83 6
Ostorhinchus apogonoides 30 52 96 7
Parupeneus barberinus 16 82 496 6
Plectropomus laevis 31 356 957 22
Pristiapogon taeniopterus 32 51 104 8
Sargocentron microstoma 23 62 204 13
Scarus psittacus 8 195 311 6
Siganus argenteus 11 236 388 13
Siganus spinus 4 199 254 3
Stegastes albifasciatus 7 43 94 8
Stegastes nigricans 14 45 138 13
Zebrasoma scopas 18 110 166 24

1.1.3 Individuals by location

data_complete %>%
  group_by(Species, Location) %>% 
  summarise(n = length(unique(ID))) %>% 
  pivot_wider(names_from = Location, values_from = n) %>% 
  mutate(Gambiers = cell_spec(Gambiers, "html", color = ifelse(is.na(Gambiers), "white", "#446CB3")),
         Hao = cell_spec(Hao, "html", color = ifelse(is.na(Hao), "white", "#446CB3")),
         Marquesas = cell_spec(Marquesas, "html", color = ifelse(is.na(Marquesas), "white", "#446CB3")),
         Moorea = cell_spec(Moorea, "html", color = ifelse(is.na(Moorea), "white", "#446CB3")),
         Manuae = cell_spec(Manuae, "html", color = ifelse(is.na(Manuae), "white", "#446CB3")),
         Tuamotu = cell_spec(Tuamotu, "html", color = ifelse(is.na(Tuamotu), "white", "#446CB3"))) %>% 
  kable(., 
        format = "html", escape = FALSE,
        caption = "Table 3. Number of individuals of each species by location. Note the number of individuals for which back-calculated data are available are likely to be different than those presented in this table.") %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  column_spec(1, italic = T)
Table 3. Number of individuals of each species by location. Note the number of individuals for which back-calculated data are available are likely to be different than those presented in this table.
Species Gambiers Moorea Manuae Marquesas Tuamotu Hao
Abudefduf sexfasciatus 11 5 NA NA NA NA
Acanthurus achilles 7 NA 10 NA NA NA
Acanthurus lineatus NA NA NA 8 NA NA
Acanthurus nigricans NA NA NA 8 NA NA
Acanthurus pyroferus NA NA NA 18 NA NA
Acanthurus triostegus 3 11 NA 4 NA NA
Balistapus undulatus NA 14 NA 8 NA NA
Caranx melampygus NA 5 NA NA 2 NA
Centropyge bispinosa NA 9 NA NA NA NA
Centropyge flavissima 9 7 NA 12 NA NA
Cephalopholis argus 6 10 NA NA 10 15
Cephalopholis urodeta 8 NA NA NA NA NA
Chaetodon citrinellus NA 13 NA NA NA NA
Chaetodon ornatissimus 4 NA NA 6 NA NA
Cheilinus chlorourus 2 6 NA NA NA NA
Chlorurus spilurus 13 19 NA NA 2 NA
Chromis iomelas NA 20 NA NA NA NA
Chromis viridis 6 NA NA NA NA NA
Ctenochaetus marginatus NA NA NA 15 NA NA
Ctenochaetus striatus 11 15 NA NA NA NA
Dascyllus aruanus NA 20 NA NA NA NA
Dascyllus flavicaudus 8 NA NA NA NA NA
Epibulus insidiator 12 5 NA NA NA NA
Epinephelus fasciatus NA NA NA 10 NA NA
Epinephelus hexagonatus NA NA NA NA NA 16
Epinephelus merra 13 20 NA NA NA 13
Epinephelus polyphekadion NA NA NA NA NA 14
Gnathodentex aureolineatus 8 NA NA NA NA NA
Gymnosarda unicolor 4 NA NA NA NA NA
Halichoeres trimaculatus 7 6 NA NA NA NA
Lutjanus fulvus NA 6 NA NA 6 NA
Lutjanus gibbus NA NA NA 17 NA NA
Lutjanus kasmira 2 NA NA 35 NA NA
Monotaxis grandoculis 5 3 NA NA 1 NA
Mulloidichthys flavolineatus NA 14 NA NA NA NA
Myripristis berndti 7 15 NA 8 NA NA
Naso lituratus 11 6 NA NA NA NA
Naso unicornis 4 NA NA NA NA NA
Odonus niger NA 13 NA 5 NA NA
Ostorhinchus angustatus NA 15 NA NA NA NA
Ostorhinchus apogonoides NA NA NA 30 NA NA
Parupeneus barberinus 5 4 NA 7 NA NA
Plectropomus laevis 12 NA NA NA NA 19
Pristiapogon taeniopterus NA NA NA 32 NA NA
Sargocentron microstoma NA 17 NA 6 NA NA
Scarus psittacus NA 3 NA NA 5 NA
Siganus argenteus 6 2 NA NA 3 NA
Siganus spinus NA 4 NA NA NA NA
Stegastes albifasciatus NA 7 NA NA NA NA
Stegastes nigricans 3 11 NA NA NA NA
Zebrasoma scopas 5 13 NA NA NA NA

1.1.4 Number of NA

# 1. Number of NA by variable

data_complete %>%
  summarise_all(~(sum(is.na(.)))) %>% 
  t(.) %>% 
  as.data.frame() %>% 
  kable(., col.names = c("NA"), caption = "Table 4. Number of rows with Non-Available (NA) data by variable") %>% 
  kable_styling(bootstrap_options = c("striped", "hover"))
Table 4. Number of rows with Non-Available (NA) data by variable
NA
Family 0
Genus 0
Species 0
ID 0
Agei 0
Ri 387
Agecpt 0
Rcpt 0
Lcpt 0
L0p 0
R0p 2811
Li_sp_m 410
Li_sp_sd 410
Li_sploc_m 757
Li_sploc_sd 757
Weight 603
Location 0
Observer 0

1.2 Plot

1.2.1 Agei vs Ri

ggplot(data_complete, aes(x = Agei, y = Ri)) +
  geom_point(color = col_color_graph, fill = col_fill_graph, size = 1, shape = 21)+
  theme(strip.text.x = element_text(size = 8, face = "italic"),
        strip.background = element_rect(colour = "black", fill = col_facet, size = 1),
        plot.title = element_text(colour = col_color_graph),
        plot.subtitle = element_text(colour = "black")) +
  facet_wrap(~Species, scales = "free", ncol = 5) +
  labs(x = "Age (years)", y = "Radius (mm)")
Figure 1. Relation between otolith radius (Ri) and age (Agei), by species.

Figure 1. Relation between otolith radius (Ri) and age (Agei), by species.

1.2.2 Agei vs Li (sp.)

ggplot(data_complete, aes(x = Agei, y = Li_sp_m)) +
  geom_point(color = col_color_graph, fill = col_fill_graph, size = 1, shape = 21)+
  theme(strip.text.x = element_text(size = 8),
        strip.background = element_rect(colour = "black", fill = col_facet, size = 1),
        plot.title = element_text(colour = col_color_graph),
        plot.subtitle = element_text(colour = "black"),
        strip.text.y = element_text(angle = 360, face = "italic")) +
  facet_wrap(~Species, scales = "free", ncol = 5) +
  labs(x = "Age (years)", y = "Length (mm)")
Figure 2. Relation between length (TL, mm) and age, by species.

Figure 2. Relation between length (TL, mm) and age, by species.

1.2.3 Agei vs Li (sp. and loc.)

ggplot(data_complete, aes(x = Agei, y = Li_sploc_m)) +
  geom_point(color = col_color_graph, fill = col_fill_graph, size = 1, shape = 21)+
  theme(strip.text.x = element_text(size = 8),
        strip.background = element_rect(colour = "black", fill = col_facet, size = 1),
        plot.title = element_text(colour = col_color_graph),
        plot.subtitle = element_text(colour = "black"),
        strip.text.y = element_text(angle = 360, face = "italic")) +
  facet_grid(Species~Location, scales = "free") +
  labs(x = "Age (years)", y = "Length (mm)")
Figure 3. Relation between length (TL, mm) and age, by species and location.

Figure 3. Relation between length (TL, mm) and age, by species and location.

2. VBGF results

2.1 Growth parameters (sp. loc.)

# 1. Growth parameters ----

read.csv("./../data/03_back-calculated_vbgf_predictions_sploc.csv") %>% 
  mutate(Estimate = paste0(round(Estimate, 3), " (", round(Est.Error, 3), ")")) %>% 
  pivot_wider(c("Species", Location), names_from = Parameter, values_from = Estimate) %>% 
  select(Species, Location, linf, k, t0) %>% 
  arrange(Species) %>% 
  kable(., 
        col.names = c("Species", "Location", "Linf", "K", "t0"), 
        caption = "Table 5. Values of Von Bertalanffy parameters estimated through Bayesian framework by species and location. Standard deviation are the values in parentheses. Linf is expressed in TL and cm.") %>% 
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  column_spec(1, italic = T)
Table 5. Values of Von Bertalanffy parameters estimated through Bayesian framework by species and location. Standard deviation are the values in parentheses. Linf is expressed in TL and cm.
Species Location Linf K t0
Abudefduf sexfasciatus Gambiers 14.756 (0.442) 0.933 (0.096) -0.036 (0.032)
Acanthurus achilles Manuae 19.203 (0.647) 0.986 (0.123) -0.039 (0.036)
Acanthurus lineatus Marquesas 29.874 (5.013) 0.326 (0.142) -0.471 (0.425)
Acanthurus nigricans Marquesas 16.976 (0.997) 1.139 (0.177) -0.02 (0.025)
Acanthurus pyroferus Marquesas 19.925 (1.267) 0.472 (0.09) -0.189 (0.139)
Acanthurus triostegus Moorea 15.704 (0.509) 0.628 (0.065) -0.096 (0.049)
Balistapus undulatus Marquesas 22.124 (3.352) 0.31 (0.161) -0.212 (0.144)
Balistapus undulatus Moorea 23.579 (7.632) 0.197 (0.08) -0.743 (0.571)
Caranx melampygus Moorea 92.984 (4.784) 0.085 (0.009) -0.585 (0.185)
Centropyge bispinosa Moorea 5.309 (0.889) 0.897 (0.866) -0.071 (0.037)
Centropyge flavissima Marquesas 7.356 (1.75) 0.905 (0.332) -0.049 (0.049)
Centropyge flavissima Moorea 8.197 (0.752) 1.199 (0.288) -0.03 (0.027)
Centropyge flavissima Gambiers 15.774 (3.627) 0.121 (0.067) -2.231 (1.364)
Cephalopholis argus Moorea 36.973 (8.569) 0.256 (0.109) -0.313 (0.291)
Cephalopholis argus Tuamotu 39.694 (7.17) 0.149 (0.077) -1.155 (0.719)
Cephalopholis argus Gambiers 42.924 (1.582) 0.2 (0.022) -0.655 (0.174)
Cephalopholis argus Hao 37.983 (5.701) 0.25 (0.051) -0.274 (0.072)
Cephalopholis urodeta Gambiers 20.459 (1.914) 0.152 (0.03) -0.626 (0.169)
Chaetodon ornatissimus Marquesas 11.167 (6.416) 1.308 (0.589) 0.311 (0.584)
Chlorurus spilurus Moorea 22.599 (1.415) 1.036 (0.187) -0.024 (0.042)
Chlorurus spilurus Gambiers 22.636 (1.175) 0.701 (0.097) -0.068 (0.046)
Chromis iomelas Moorea 5.066 (0.437) 1.145 (0.242) -0.06 (0.026)
Chromis viridis Gambiers 11.812 (1.153) 0.884 (0.25) -0.055 (0.06)
Ctenochaetus marginatus Marquesas 23.135 (2.877) 0.349 (0.082) -0.169 (0.077)
Ctenochaetus striatus Moorea 17.286 (0.565) 1.013 (0.087) -0.028 (0.02)
Ctenochaetus striatus Gambiers 17.078 (0.549) 0.501 (0.044) -0.141 (0.056)
Dascyllus aruanus Moorea 5.607 (0.212) 0.897 (0.096) -0.055 (0.028)
Dascyllus flavicaudus Gambiers 9.325 (0.632) 0.343 (0.042) -0.239 (0.076)
Epibulus insidiator Gambiers 26.751 (1.847) 0.306 (0.038) -0.257 (0.078)
Epinephelus fasciatus Marquesas 22.098 (1.801) 0.553 (0.077) -0.05 (0.036)
Epinephelus hexagonatus Hao 21.735 (1.043) 0.524 (0.06) -0.092 (0.052)
Epinephelus merra Moorea 14.308 (0.907) 1.126 (0.092) -0.017 (0.015)
Epinephelus merra Gambiers 18.697 (0.898) 0.598 (0.073) -0.11 (0.059)
Epinephelus merra Hao 22.536 (0.601) 0.794 (0.078) -0.05 (0.037)
Epinephelus polyphekadion Hao 55.015 (5.758) 0.153 (0.021) -0.412 (0.095)
Gnathodentex aureolineatus Gambiers 20.493 (0.992) 0.38 (0.056) -0.288 (0.119)
Halichoeres trimaculatus Gambiers 18.014 (1.691) 0.707 (0.148) -0.034 (0.054)
Lutjanus fulvus Moorea 19.088 (8.694) 8.277 (22.6) -0.073 (0.087)
Lutjanus fulvus Tuamotu 26.693 (2.498) 0.295 (0.057) -0.41 (0.178)
Mulloidichthys flavolineatus Moorea 25.687 (0.535) 1.274 (0.091) -0.013 (0.013)
Myripristis berndti Gambiers 24.025 (1.876) 0.272 (0.05) -0.524 (0.301)
Myripristis berndti Marquesas 21.911 (0.537) 0.328 (0.031) -0.355 (0.111)
Myripristis berndti Moorea 18.009 (0.964) 0.434 (0.051) -0.154 (0.054)
Naso lituratus Gambiers 31.949 (1.959) 1.24 (0.176) -0.01 (0.018)
Odonus niger Moorea 21.849 (6.476) 0.621 (0.8) -0.063 (0.105)
Ostorhinchus angustatus Moorea 7.405 (0.407) 0.602 (0.082) -0.125 (0.041)
Ostorhinchus apogonoides Marquesas 8.167 (0.211) 0.918 (0.057) -0.066 (0.012)
Plectropomus laevis Gambiers 93.868 (4.547) 0.143 (0.019) -0.65 (0.157)
Plectropomus laevis Hao 91.614 (5.686) 0.275 (0.031) -0.026 (0.026)
Pristiapogon taeniopterus Marquesas 7.992 (0.268) 0.849 (0.072) -0.083 (0.024)
Sargocentron microstoma Moorea 16.284 (0.556) 0.659 (0.053) -0.055 (0.028)
Siganus argenteus Gambiers 34.697 (4.895) 0.205 (0.06) -0.439 (0.257)
Stegastes nigricans Moorea 13.386 (2.113) 0.312 (0.153) -0.346 (0.204)

2.2 Growth curves (sp. loc.)

# 1. Growth curves ----

read.csv("./../data/03_back-calculated_vbgf_fitted_sploc.csv") %>% 
  ggplot(data = .) +
    geom_ribbon(aes(x = age, ymin = ypred_lq, ymax = ypred_uq, fill = Location), alpha = 0.5) +
    geom_line(aes(x = age, y = ypred_m, color = Location)) +
    geom_point(data = data_complete %>%
                 mutate(Li_sp_m = Li_sp_m/10), 
               aes(x = Agei, y = Li_sp_m, color = Location), size = 1) +
    facet_wrap(~Species, scales = "free", ncol = 5) +
    lims(y = c(0, NA)) +
    theme(strip.text.x = element_text(face = "italic")) +
    labs(x = "Age (years)", y = "Length (TL, cm)") +
    guides(colour = guide_legend(override.aes = list(alpha = 1, size = 0.5)))
Figure 4. Growth curves by species and location.

Figure 4. Growth curves by species and location.

2.3 Growth curves (sp.)

# 1. Growth curves ----

read.csv("./../data/03_back-calculated_vbgf_fitted_sp.csv") %>% 
  ggplot(data = .) +
    geom_ribbon(aes(x = age, ymin = ypred_lq, ymax = ypred_uq), alpha = 0.5, fill = col_fill_graph, alpha = 0.6) +
    geom_line(aes(x = age, y = ypred_m), color = col_color_graph) +
    geom_point(data = data_complete %>%
                 mutate(Li_sp_m = Li_sp_m/10), 
               aes(x = Agei, y = Li_sp_m), color = col_color_graph, fill = col_fill_graph, size = 1, shape = 21) +
    facet_wrap(~Species, scales = "free", ncol = 5) +
    lims(y = c(0, NA)) +
    theme(strip.text.x = element_text(face = "italic")) +
    labs(x = "Age (years)", y = "Length (TL, cm)") +
    guides(colour = guide_legend(override.aes = list(alpha = 1, size = 0.5)))
Figure 5. Growth curves by species.

Figure 5. Growth curves by species.

3. Raw vs Back-calculation

3.1 Growth parameters (sp. loc.)

# 1. List of species with enough individuals for one location ----

species_list <- c("Abudefduf sexfasciatus", "Acanthurus triostegus", "Chromis iomelas", 
                  "Dascyllus aruanus", "Myripristis berndti", "Ostorhinchus apogonoides", 
                  "Pristiapogon taeniopterus", "Stegastes nigricans")

# 1. Growth parameters ----

read.csv("./../data/03_raw_vbgf_predictions_sploc.csv") %>% 
  filter(Species %in% species_list) %>% 
  mutate(Value = paste0(round(Estimate, 3), " (", round(Est.Error, 3), ")")) %>% 
  select(Species, Location, Parameter, Value) %>% 
  pivot_wider(1:2, names_from = Parameter, values_from = Value) %>% 
  select(Species, Location, Linf, K, t0) %>% 
  arrange(Species) %>% 
  kable(., 
        col.names = c("Species", "Location", "Linf", "K", "t0"), 
        caption = "Table 5. Values of Von Bertalanffy parameters estimated through Bayesian framework by species and location. Standard deviation are the values in parentheses. Linf is expressed in TL and cm.") %>% 
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  column_spec(1, italic = T)
Table 5. Values of Von Bertalanffy parameters estimated through Bayesian framework by species and location. Standard deviation are the values in parentheses. Linf is expressed in TL and cm.
Species Location Linf K t0
Abudefduf sexfasciatus Gambiers 16.187 (0.28) 1.438 (0.279) -0.142 (0.241)
Acanthurus triostegus Moorea 17.384 (0.46) 0.881 (0.242) -0.054 (0.259)
Chromis iomelas Moorea 5.419 (0.282) 1.115 (0.251) -0.295 (0.153)
Dascyllus aruanus Moorea 6.241 (0.178) 0.935 (0.189) -0.076 (0.253)
Myripristis berndti Moorea 24.015 (2.89) 0.231 (0.155) 0.059 (0.262)
Ostorhinchus apogonoides Marquesas 9.249 (0.284) 0.559 (0.07) -0.347 (0.12)
Pristiapogon taeniopterus Marquesas 9.053 (0.37) 0.625 (0.136) -0.261 (0.175)
Stegastes nigricans Moorea 13.884 (0.763) 0.34 (0.062) 0.077 (0.234)

3.2 Growth curves (sp. loc.)

# 1. Transform the raw data ----

# 1.1 Points --

data_raw_points <- read.csv("./../data/02_back-calculated-size-at-age_morat-et-al.csv") %>%
  filter(Species %in% species_list) %>% 
  select(Family, Genus, Species, ID, Agecpt, Lcpt, Location, Observer) %>% 
  unique() %>%
  dplyr::group_by(Species, Location) %>%
  dplyr::mutate(n = length(unique(ID))) %>%
  filter(n >= 10) %>% # filter with at least 10 replicates
  ungroup() %>% 
  dplyr::mutate(Lcpt = Lcpt/10) %>%  # Convert to cm
  mutate(Type = "Raw")

# 1.2 Curves -- 

data_raw_curve <- read.csv("./../data/03_raw_vbgf_fitted_sploc.csv") %>% 
  filter(Species %in% species_list) %>% 
  mutate(Type = "Raw")

# 2. Transform the back-calculated data ----

# 2.1 Points --

data_backcalc_points <- read.csv("./../data/02_back-calculated-size-at-age_morat-et-al.csv") %>% 
  filter(Species %in% species_list,
         !(Species == "Abudefduf sexfasciatus" & Location == "Moorea"),
         !(Species == "Acanthurus triostegus" & Location == "Marquesas"),
         !(Species == "Myripristis berndti" & Location == "Gambiers"),
         !(Species == "Myripristis berndti" & Location == "Marquesas")) %>% 
  dplyr::mutate(Li_sploc_m = Li_sploc_m/10) %>%  # Convert to cm
  mutate(Type = "Back-calculated")

# 2.2 Curves --

data_backcalc_curve <- read.csv("./../data/03_back-calculated_vbgf_fitted_sploc.csv") %>% 
  filter(Species %in% species_list,
         !(Species == "Abudefduf sexfasciatus" & Location == "Moorea"),
         !(Species == "Acanthurus triostegus" & Location == "Marquesas"),
         !(Species == "Myripristis berndti" & Location == "Gambiers"),
         !(Species == "Myripristis berndti" & Location == "Marquesas")) %>% 
  mutate(Type = "Back-calculated")

# 2. Make the plot ----

ggplot() +
  # Raw data
  geom_ribbon(data = data_raw_curve, aes(x = Agei, ymin = Q2.5, ymax = Q97.5, fill = Type), alpha = 0.5) +
  geom_line(data = data_raw_curve, aes(x = Agei, y = Estimate, color = Type), show.legend = FALSE) +
  #geom_point(data = data_raw_points, aes(x = Agecpt, y = Lcpt, color = Type), size = 1) +
  # Back-calculated data
  geom_ribbon(data = data_backcalc_curve, aes(x = age, ymin = ypred_lq, ymax = ypred_uq, fill = Type), alpha = 0.5) +
  geom_line(data = data_backcalc_curve, aes(x = age, y = ypred_m, color = Type), show.legend = FALSE) +
  #geom_point(data = data_backcalc_points, aes(x = Agei, y = Li_sploc_m, color = Type), size = 1) +
  # Appearance
  facet_wrap(~Species, scales = "free", ncol = 4) +
  lims(y = c(0, NA)) +
  theme(strip.text.x = element_text(face = "italic"),
        legend.position = "top",
        legend.title = element_blank()) +  labs(x = "Age (years)", y = "Length (TL, cm)") +
  lims(y = c(0, NA), x = c(0, NA)) +
  scale_color_manual(values = c(col_color_graph, "#d91e18")) +
  scale_fill_manual(values = c(col_fill_graph, "#e74c3c")) +
  guides(colour = guide_legend(override.aes = list(alpha = 1, size = 0.5)))
Figure 6. Comparison of growth curves by species and location (one location only by growth curve) between back-calculated data and population-level data.

Figure 6. Comparison of growth curves by species and location (one location only by growth curve) between back-calculated data and population-level data.

# 3. Remove useless objects ----

rm(data_raw_points, data_raw_curve, data_backcalc_points, data_backcalc_curve)

3.3 Growth curves (sp.)

# 1. List of species with enough individuals for one location ----

species_list <- c("Abudefduf sexfasciatus", "Acanthurus achilles", "Acanthurus pyroferus", 
                  "Acanthurus triostegus", "Balistapus undulatus", "Centropyge flavissima",
                  "Chaetodon ornatissimus", "Chromis iomelas", "Ctenochaetus marginatus",
                  "Dascyllus aruanus", "Epinephelus hexagonatus", "Myripristis berndti",
                  "Odonus niger", "Ostorhinchus angustatus", "Ostorhinchus apogonoides",
                  "Pristiapogon taeniopterus", "Sargocentron microstoma", "Stegastes nigricans")

# 1. Transform the raw data ----

# 1.1 Points --

data_raw_points <- read.csv("./../data/02_back-calculated-size-at-age_morat-et-al.csv") %>%
  filter(Species %in% species_list) %>% 
  select(Family, Genus, Species, ID, Agecpt, Lcpt, Location, Observer) %>% 
  unique() %>%
  dplyr::group_by(Species, Location) %>%
  dplyr::mutate(n = length(unique(ID))) %>%
  filter(n >= 10) %>% # filter with at least 10 replicates
  ungroup() %>% 
  dplyr::mutate(Lcpt = Lcpt/10) %>%  # Convert to cm
  mutate(Type = "Population-level data")

# 1.2 Curves -- 

data_raw_curve <- read.csv("./../data/03_raw_vbgf_fitted_sp.csv") %>% 
  filter(Species %in% species_list) %>% 
  mutate(Type = "Population-level data")

# 2. Transform the back-calculated data ----

# 2.1 Points --

data_backcalc_points <- read.csv("./../data/02_back-calculated-size-at-age_morat-et-al.csv") %>% 
  filter(Species %in% species_list) %>% 
  dplyr::mutate(Li_sp_m = Li_sp_m/10) %>%  # Convert to cm
  mutate(Type = "Back-calculated data")

# 2.2 Curves --

data_backcalc_curve <- read.csv("./../data/03_back-calculated_vbgf_fitted_sp.csv") %>% 
  filter(Species %in% species_list) %>% 
  mutate(Type = "Back-calculated data")

# 2. Make the plot ----

ggplot() +
  # Raw data
  geom_ribbon(data = data_raw_curve, aes(x = Agei, ymin = Q2.5, ymax = Q97.5, fill = Type), alpha = 0.5) +
  geom_line(data = data_raw_curve, aes(x = Agei, y = Estimate, color = Type), show.legend = FALSE) +
  #geom_point(data = data_raw_points, aes(x = Agecpt, y = Lcpt, color = Type), size = 1) +
  # Back-calculated data
  geom_ribbon(data = data_backcalc_curve, aes(x = age, ymin = ypred_lq, ymax = ypred_uq, fill = Type), alpha = 0.5) +
  geom_line(data = data_backcalc_curve, aes(x = age, y = ypred_m, color = Type), show.legend = FALSE) +
  #geom_point(data = data_backcalc_points, aes(x = Agei, y = Li_sp_m, color = Type), size = 1) +
  # Appearance
  facet_wrap(~Species, scales = "free", ncol = 3) +
  lims(y = c(0, NA)) +
  theme(strip.text.x = element_text(face = "italic"),
        legend.position = "top",
        legend.title = element_blank()) +
  labs(x = "Age (years)", y = "Length (TL, cm)") +
  lims(y = c(0, NA), x = c(0, NA)) +
  scale_color_manual(values = c(col_color_graph, "#d91e18")) +
  scale_fill_manual(values = c(col_fill_graph, "#e74c3c")) +
  guides(colour = guide_legend(override.aes = list(alpha = 1, size = 0.5)))
Figure 7. Comparison of growth curves by species between back-calculated data and population-level data.

Figure 7. Comparison of growth curves by species between back-calculated data and population-level data.

# 3. Remove useless objects ----

rm(data_raw_points, data_raw_curve, data_backcalc_points, data_backcalc_curve)

4. Comparison with literature

# 1. Import file synthesizing the VBGF parameters from literature ----

vbgf_literature <- read_excel("./../data/00_von-bertalanffy-literature.xlsx", sheet = 1) %>% 
  dplyr::mutate(Linf = ifelse(Size_unit == "mm", Linf/10, Linf),
                Size_max = ifelse(Size_unit == "mm", Size_max/10, Size_max)) %>% # Convert all length values to cm
  select(-Family, -Genus) # Remove Family and Genus to add those level through fishbase

# 2. Check validity of species names ----

vbgf_literature <- vbgf_literature %>% 
  rowwise() %>% 
  dplyr::mutate(Species2 = ifelse(is_empty(validate_names(Species)) == TRUE, 
                           NA, 
                           validate_names(Species))) %>% # Correct the names through fishbase
  ungroup() %>% 
  dplyr::mutate(Species = str_replace_all(Species, c("Acanthurus chirugus" = "Acanthurus chirurgus",
                                                     "Scarus psitticus" = "Scarus psittacus"))) %>% # Correct unfound names
  filter(Species %in% unique(data_complete$Species)) %>% 
  mutate(Reference = paste0(Reference, " (", Reference_type, ")")) %>%
  mutate_at(c("Linf", "K", "t0"), as.character) %>% 
  select(-Size_unit, -Sex, -Reference_type, -Species2) %>% 
  arrange(Species)

4.1 Growth parameters

4.1.1 Table

# 1. Comparison of VBGF parameters between our study and literature ----

read.csv("./../data/03_back-calculated_vbgf_predictions_sp.csv") %>% 
  mutate(Estimate = paste0(round(Estimate, 3), " (", round(Est.Error, 3), ")")) %>% 
  pivot_wider(c("Species"), names_from = Parameter, values_from = Estimate) %>% 
  select(Species, linf, k, t0) %>% 
  rename(Linf = linf, K = k) %>% 
  mutate(Reference = "This study") %>% 
  full_join(., vbgf_literature) %>%
  select(Species, Linf, K, t0, Reference) %>% 
  arrange(Species) %>% 
  kable(.,
        format = "html", escape = FALSE,
        col.names = c("Species", "Linf", "K", "t0", "Reference"), 
        caption = "Table 6. Comparison between growth parameters estimated by species through Bayesian framework, with data from literature.") %>% 
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  column_spec(1, italic = T)
Table 6. Comparison between growth parameters estimated by species through Bayesian framework, with data from literature.
Species Linf K t0 Reference
Abudefduf sexfasciatus 14.755 (0.436) 0.932 (0.095) -0.037 (0.033) This study
Acanthurus achilles 13.883 (7.783) 1.067 (0.217) 0.254 (0.51) This study
Acanthurus lineatus 26.947 (3.263) 0.399 (0.117) -0.212 (0.156) This study
Acanthurus lineatus 18.274 0.462 -0.32 Choat and Robertson, 2002 (Article)
Acanthurus lineatus 22.1 0.12 -15.6 Craig et al, 1997 (Article)
Acanthurus lineatus 18.909 0.68 NA Gust et al, 2002 (Article)
Acanthurus lineatus 17.484 0.34 NA Gust et al, 2002 (Article)
Acanthurus lineatus 17 0.416 -0.329 Ralston and Williams, 1988 (Report)
Acanthurus nigricans 16.973 (1.012) 1.138 (0.177) -0.02 (0.025) This study
Acanthurus nigricans 14.286 0.28 -0.69 Choat and Robertson, 2002 (Article)
Acanthurus pyroferus 19.956 (1.279) 0.47 (0.09) -0.188 (0.137) This study
Acanthurus triostegus 15.823 (0.404) 0.626 (0.053) -0.09 (0.041) This study
Balistapus undulatus 23.506 (3.034) 0.195 (0.037) -0.456 (0.136) This study
Caranx melampygus 89.61 (4.906) 0.085 (0.009) -0.52 (0.18) This study
Caranx melampygus 89.7 0.233 -0.044 Sudekum et al, 1991 (Article)
Centropyge bispinosa 5.324 (0.871) 0.905 (3.766) -0.07 (0.036) This study
Centropyge flavissima 9.193 (0.683) 0.477 (0.09) -0.168 (0.073) This study
Cephalopholis argus 37.269 (9.108) 0.224 (0.078) -0.582 (0.322) This study
Cephalopholis argus 50.6 0.075 -6.5 Donovan et al, 2013 (Article)
Cephalopholis argus 48.5499 0.049 -14.145 Mapleston et al, 2009 (Report)
Cephalopholis argus 44.22 0.26 1.33 Mehanna et al, 2019 (Article)
Cephalopholis argus 39.901 0.271 -0.169 Pears, 2005 (PhD Thesis)
Cephalopholis argus 37.119 0.339 -0.147 Pears, 2005 (PhD Thesis)
Cephalopholis argus 31.44 0.255 0 Moore et al, 2015b (Report)
Cephalopholis urodeta 20.459 (1.911) 0.152 (0.031) -0.622 (0.17) This study
Cephalopholis urodeta 20.645 0.31 NA Payet et al, 2016 (Article)
Cephalopholis urodeta 14.5 1.39 NA Fry et al, 2006 (Article)
Chaetodon citrinellus 9.07 2.15 -0.074 Berumen et al, 2005 (Article)
Chaetodon ornatissimus 14.512 (0.731) 0.956 (0.141) -0.028 (0.04) This study
Chlorurus spilurus 22.803 (0.919) 0.806 (0.087) -0.043 (0.032) This study
Chlorurus spilurus 34.4 0.4 -0.13 DeMartini et al, 2017 (Article)
Chlorurus spilurus 21.8 0.95 -0.075 Taylor and Choat, 2014 (Article)
Chromis iomelas 5.046 (0.394) 1.153 (0.236) -0.059 (0.026) This study
Chromis viridis 11.786 (1.147) 0.889 (0.282) -0.055 (0.06) This study
Ctenochaetus marginatus 21.143 (1.542) 0.402 (0.04) -0.142 (0.046) This study
Ctenochaetus striatus 17.157 (0.413) 0.747 (0.048) -0.061 (0.026) This study
Ctenochaetus striatus 17.2 0.75 -0.4 Trip et al, 2008 (Article)
Ctenochaetus striatus 18.2 0.5 -0.6 Trip et al, 2008 (Article)
Ctenochaetus striatus 17.6 1.4 -0.2 Trip et al, 2008 (Article)
Ctenochaetus striatus 17.8 0.7 -0.4 Trip et al, 2008 (Article)
Ctenochaetus striatus 15.9 0.5 -0.7 Trip et al, 2008 (Article)
Ctenochaetus striatus 12.8 0.6 -0.7 Trip et al, 2008 (Article)
Ctenochaetus striatus 19.4 1 -0.3 Trip et al, 2008 (Article)
Ctenochaetus striatus 17.1 0.9 -0.4 Trip et al, 2008 (Article)
Ctenochaetus striatus 20.1 0.8 -0.3 Trip et al, 2008 (Article)
Ctenochaetus striatus 19.9 0.3 -0.8 Trip et al, 2008 (Article)
Ctenochaetus striatus 23.2 1.3 -0.2 Trip et al, 2008 (Article)
Ctenochaetus striatus 20.5 2.1 -0.1 Trip et al, 2008 (Article)
Ctenochaetus striatus 18.5 1.1 -0.3 Trip et al, 2008 (Article)
Ctenochaetus striatus 18.8 0.4 -0.6 Trip et al, 2008 (Article)
Ctenochaetus striatus 19.4 0.4 -0.7 Trip et al, 2008 (Article)
Ctenochaetus striatus 16.8 0.591 -0.27 Choat and Robertson, 2002 (Article)
Ctenochaetus striatus 13.2 0.66 -0.16 Fidler et al, 2018 (Article)
Ctenochaetus striatus 11.9 0.72 -0.12 Fidler et al, 2018 (Article)
Ctenochaetus striatus 12.5 0.49 -0.36 Fidler et al, 2018 (Article)
Ctenochaetus striatus 11.9 0.72 -0.12 Fidler et al, 2018 (Article)
Ctenochaetus striatus 12.6 0.69 -0.05 Fidler et al, 2018 (Article)
Ctenochaetus striatus 11.9 0.72 -0.12 Fidler et al, 2018 (Article)
Ctenochaetus striatus 17 0.9 0.2 Ochavillo et al, 2011 (Article)
Ctenochaetus striatus 25.6 0.424 -0.643 Ralston and Williams, 1988 (Report)
Ctenochaetus striatus 16.92 0.63 0 Moore et al, 2013a (Report)
Ctenochaetus striatus 15.75 1.09 0 Moore et al, 2013b (Report)
Ctenochaetus striatus 16.8 0.98 0 Moore et al, 2015a (Report)
Ctenochaetus striatus 15.05 1.318 0 Moore et al, 2015b (Report)
Dascyllus aruanus 5.605 (0.211) 0.896 (0.095) -0.055 (0.028) This study
Dascyllus flavicaudus 9.354 (0.646) 0.342 (0.042) -0.24 (0.076) This study
Epibulus insidiator 29.881 (5.846) 0.258 (0.089) -0.438 (0.342) This study
Epibulus insidiator 19.894 0.25 -0.172 Hubble, 2003 (PhD Thesis)
Epinephelus fasciatus 22.159 (1.9) 0.551 (0.08) -0.051 (0.035) This study
Epinephelus fasciatus 28.1814 0.405 -0.685 Mapleston et al, 2009 (Report)
Epinephelus fasciatus 28.213 0.469 -0.198 Pears, 2005 (PhD Thesis)
Epinephelus fasciatus 27.46 0.45 -0.212 Pears, 2005 (PhD Thesis)
Epinephelus hexagonatus 21.683 (1.016) 0.526 (0.06) -0.092 (0.053) This study
Epinephelus merra 20.403 (4.532) 0.676 (0.212) -0.06 (0.028) This study
Epinephelus merra 21.2 0.5 -0.009 Pothin et al, 2004 (Article)
Epinephelus merra 16.46 1.01 0 Moore et al, 2013a (Report)
Epinephelus polyphekadion 57.578 (7.425) 0.14 (0.031) -0.41 (0.103) This study
Epinephelus polyphekadion 44.71 0.251 -0.14 Rhodes et al, 2011 (Article)
Epinephelus polyphekadion 57.9 0.18 0 Grandcourt, 2005 (Article)
Epinephelus polyphekadion 56.58 0.139 -1.18 Ohta et al, 2017 (Article)
Epinephelus polyphekadion 56.2345 0.194 -0.081 Mapleston et al, 2009 (Report)
Epinephelus polyphekadion 53.701 0.195 -0.245 Pears, 2005 (PhD Thesis)
Epinephelus polyphekadion 58.237 0.206 -0.212 Pears, 2005 (PhD Thesis)
Gnathodentex aureolineatus 20.489 (0.996) 0.381 (0.056) -0.287 (0.119) This study
Halichoeres trimaculatus 18.058 (1.743) 0.704 (0.149) -0.034 (0.054) This study
Lutjanus fulvus 24.416 (1.129) 0.484 (0.063) -0.157 (0.079) This study
Lutjanus fulvus 26.5 0.41 -0.49 Shimose and Nanami, 2014 (Article)
Lutjanus fulvus 20.34 1.306 0 Moore et al, 2015b (Report)
Lutjanus fulvus 23.62 0.735 0 Moore et al, 2015b (Report)
Lutjanus gibbus 35.13 0.29 -1 Moore, 2019 (Article)
Lutjanus gibbus 39.05 0.21 -1.88 Nanami et al, 2010 (Article)
Lutjanus gibbus 30.34 0.256 -3.05 Nanami et al, 2010 (Article)
Lutjanus gibbus 54.4 0.06 -9.48 Heupel et al, 2010b (Article)
Lutjanus gibbus 35.2 0.51 NA Currey et al, 2010 (Report)
Lutjanus gibbus 27.4 0.78 -0.24 Holloway et al, 2015 (Article)
Lutjanus gibbus 34 0.38 0 Moore et al, 2013a (Report)
Lutjanus gibbus 29.35 0.44 0 Moore et al, 2013a (Report)
Lutjanus gibbus 28.47 0.53 0 Moore et al, 2013b (Report)
Lutjanus gibbus 26.5 0.57 0 Moore et al, 2013b (Report)
Lutjanus gibbus 30.5 0.57 0 Moore et al, 2015a (Report)
Lutjanus gibbus 26.7 0.83 0 Moore et al, 2015a (Report)
Lutjanus gibbus 32.48 0.547 0 Moore et al, 2015b (Report)
Lutjanus gibbus 26.67 0.729 0 Moore et al, 2015b (Report)
Lutjanus kasmira 34 0.29 -1.37 Morales-Nin and Ralston, 1990 (Article)
Lutjanus kasmira 29.6 0.384 -1.349 Ralston and Williams, 1988 (Report)
Lutjanus kasmira 22.37 0.6 0 Moore et al, 2013a (Report)
Lutjanus kasmira 19.75 0.91 0 Moore et al, 2013a (Report)
Mulloidichthys flavolineatus 19.461 (10.823) 2.057 (1.362) 0.298 (0.539) This study
Mulloidichthys flavolineatus 38 0.27 -1.15 Mehanna et al, 2017 (Article)
Myripristis berndti 20.904 (0.791) 0.322 (0.025) -0.345 (0.066) This study
Naso lituratus 31.698 (3.972) 1.197 (0.314) -0.014 (0.023) This study
Naso lituratus 21.2 1.38 -0.2 Taylor et al, 2014 (Article)
Naso lituratus 20.4 0.93 -0.3 Taylor et al, 2014 (Article)
Naso lituratus 27.05 0.92 0 Moore et al, 2013a (Report)
Naso lituratus 23.22 1.05 0 Moore et al, 2013a (Report)
Naso lituratus 26.59 0.79 0 Moore et al, 2013b (Report)
Naso lituratus 23.43 1.11 0 Moore et al, 2013b (Report)
Naso lituratus 23.2 1.1 0 Moore et al, 2015a (Report)
Naso lituratus 19.9 1.92 0 Moore et al, 2015a (Report)
Naso lituratus 23.77 1.171 0 Moore et al, 2015b (Report)
Naso lituratus 20.72 2.055 0 Moore et al, 2015b (Report)
Naso unicornis 47.8 0.44 -0.12 Andrews et al, 2016 (Article)
Naso unicornis 47.1 0.36 -0.14 Taylor et al, 2014 (Article)
Naso unicornis 49.3 0.22 -0.48 Taylor et al, 2014 (Article)
Naso unicornis 38.577 0.489 -0.14 Choat and Robertson, 2002 (Article)
Odonus niger 25.867 (1.321) 0.424 (0.05) -0.151 (0.052) This study
Ostorhinchus angustatus 7.414 (0.416) 0.601 (0.083) -0.125 (0.042) This study
Ostorhinchus apogonoides 6.257 (3.307) 4.986 (7.045) 0.023 (0.154) This study
Plectropomus laevis 67.329 (29.406) 0.421 (0.717) -0.026 (0.449) This study
Plectropomus laevis 101.5 0.19 0 Grandcourt, 2005 (Article)
Plectropomus laevis 115.9 0.096 -2.28 Heupel et al, 2010a (Article)
Pristiapogon taeniopterus 7.984 (0.263) 0.85 (0.073) -0.083 (0.024) This study
Sargocentron microstoma 16.629 (1.494) 0.637 (0.121) -0.052 (0.028) This study
Scarus psittacus 17.21 1.19 -0.05 Choat and Robertson, 2002 (Article)
Scarus psittacus 32.7 0.486 -0.01 DeMartini et al, 2017 (Article)
Scarus psittacus 21.7 1.653 -0.29 Page, 1998 (Report)
Scarus psittacus 20.7 0.91 -0.083 Taylor and Choat, 2014 (Article)
Siganus argenteus 36.043 (4.785) 0.247 (0.063) -0.252 (0.155) This study
Siganus argenteus 27.4 0.9 -0.3 Taylor et al, 2016 (Article)
Stegastes nigricans 13.327 (2.09) 0.32 (0.473) -0.344 (0.2) This study
Zebrasoma scopas 13.282 0.425 -0.49 Choat and Robertson, 2002 (Article)

4.1.2 Plot

# 1. Comparison of VBGF parameters between our study and literature ----

vbgf_literature %>% 
  select(Species, Linf, K, t0, Reference) %>% 
  pivot_longer(c("Linf", "K", "t0"), names_to = "Parameter", values_to = "Estimate") %>% 
  mutate(Estimate = as.numeric(Estimate),
         Type = "Literature") %>% 
  bind_rows(., read.csv("./../data/03_back-calculated_vbgf_predictions_sp.csv") %>% 
                select(-Est.Error, -Q2.5, -Q97.5) %>% 
                mutate(Parameter = str_replace_all(Parameter, c("linf" = "Linf",
                                                                "k" = "K")),
                       Type = "This study",
                       Reference = "This study")) %>% 
  mutate(Species = as.factor(Species),
         Parameter = factor(Parameter, levels = c("Linf", "K", "t0"))) %>% 
  ggplot(data = ., aes(x = reorder(Species, desc(Species)), y = Estimate, color = Type)) +
    geom_point() +
    facet_wrap(~Parameter, scales = "free") +
    coord_flip() +
    labs(x = NULL, y = "Value") +
    theme(axis.text.y = element_text(face = "italic"))
Figure 8. Comparison of VBGF growth parameters estimated through Bayesian framework on species back-calculated data, with parameters from literature.

Figure 8. Comparison of VBGF growth parameters estimated through Bayesian framework on species back-calculated data, with parameters from literature.

4.2 Growth curves

# 1. Get predictions from literature data ----

vbgf_literature_pred <- vbgf_literature %>% 
  # Complete missing Age_max
  filter(is.na(Age_max)) %>% 
  left_join(., vbgf_literature %>% 
              group_by(Species) %>% 
              summarise(Age_max2 = max(Age_max, na.rm = TRUE)) %>% 
              mutate(Age_max2 = na_if(Age_max2, -Inf))) %>% 
  mutate(Age_max = ifelse(is.na(Age_max), Age_max2, Age_max)) %>% 
  select(-Age_max2) %>% 
  bind_rows(., vbgf_literature %>% 
              filter(!(is.na(Age_max)))) %>% 
  arrange(Species) %>% 
  # Fix missing t0 to 0
  dplyr::mutate(t0 = ifelse(is.na(t0), 0, t0)) %>% 
  filter(!(is.na(K)), !(is.na(Linf)), !(is.na(t0))) %>% 
  mutate_at(c("Linf", "K", "t0"), as.numeric) %>% 
  filter(Species %in% unique(read.csv("./../data/03_back-calculated_vbgf_fitted_sp.csv")$Species)) %>% 
  # Make the predictions
  dplyr::mutate(Line = row_number()) %>% 
  group_by(Line) %>% 
  do(pred_vbgf(data = .))

# 2. Make the plot ----

plot_final <- read.csv("./../data/03_back-calculated_vbgf_fitted_sp.csv") %>% 
  filter(Species %in% unique(vbgf_literature_pred$Species)) %>% 
  ggplot(data = .) +
  geom_line(data = vbgf_literature_pred, aes(x = Agei, y = Li, group = as.factor(Line), 
                                             text = Reference), color = "#6c7a89", size = 0.7) +
  geom_ribbon(aes(x = age, ymin = ypred_lq, ymax = ypred_uq), alpha = 0.5, fill = col_fill_graph) +
  geom_line(aes(x = age, y = ypred_m), size = 0.7, color = col_color_graph) +

  facet_wrap(~Species, ncol = 4, scales = "free") +
  labs(x = "Age (years)", y = "Length (cm)") +
  theme(strip.text.x = element_text(face = "italic")) +
  lims(y = c(0, NA), x = c(0, NA)) +
  guides(colour = guide_legend(override.aes = list(alpha = 1, size = 0.5))) +
    scale_fill_manual(values = palette_location) +
    scale_color_manual(values = palette_location)

plot_final
Figure 9. Comparison of growth curves based on VBGF growth parameters estimated through Bayesian framework on species back-calculated data with growth curves from literature.

Figure 9. Comparison of growth curves based on VBGF growth parameters estimated through Bayesian framework on species back-calculated data with growth curves from literature.

# 4. Convert to plotly ----

plot_final <- plot_final +
  theme(legend.position = "none")

ggplotly(plot_final, tooltip = c("Reference", "Location", "Size_type"))

Figure 10. Comparison of growth curves based on VBGF growth parameters estimated through Bayesian framework on species back-calculated data with growth curves from literature (interactive plot).

4.3 Maximum age

# 1. Comparison of the maximum age between our study and literature ----

vbgf_literature %>% 
  filter(!(is.na(Age_max))) %>% 
  group_by(Species) %>% 
  summarise(Age_max = max(Age_max)) %>% 
  ungroup() %>% 
  left_join(., vbgf_literature) %>% 
  select(Species, Age_max, Reference) %>% 
  right_join(., data_complete %>% 
                  mutate(Lcpt = Lcpt/10) %>% 
                  filter(!(is.na(Agecpt))) %>% 
                  group_by(Species) %>% 
                  summarise(Agecpt = max(Agecpt)) %>% 
                  ungroup()) %>% 
  select(Species, Agecpt, Age_max, Reference) %>% 
  arrange(Species) %>%
  mutate(Agecpt = as.numeric(as.character(Agecpt)),
         Age_max = as.numeric(as.character(Age_max))) %>% 
  mutate(Species = cell_spec(Species, "html", color = "black"),
         Agecpt = cell_spec(Agecpt, "html", color = "black"),
         Age_max = cell_spec(Age_max, "html", color = ifelse(is.na(Age_max), "white", "black")),
         Reference = cell_spec(Reference, "html", color = ifelse(is.na(Reference), "white", "black"))) %>% 
  kable(., 
        format = "html", escape = FALSE,
        col.names = c("Species", "Age max.", "Age max.", "Reference"),
        caption = "Table 7. Comparison of maximum age (Age max.) between this study and litterature. When value of Age max. from literature is missing for one species, it can be either due to unspecified maximum age in the reference or absent value in literature for the considered species.") %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>% 
  column_spec(1, italic = T) %>%
  add_header_above(c(" " = 1, "This Study" = 1, "Litterature" = 2))
Table 7. Comparison of maximum age (Age max.) between this study and litterature. When value of Age max. from literature is missing for one species, it can be either due to unspecified maximum age in the reference or absent value in literature for the considered species.
This Study
Litterature
Species Age max. Age max. Reference
Abudefduf sexfasciatus 13 NA NA
Acanthurus achilles 27 NA NA
Acanthurus lineatus 23 42 Gust et al, 2002 (Article)
Acanthurus nigricans 9 NA NA
Acanthurus pyroferus 19 NA NA
Acanthurus triostegus 12 NA NA
Balistapus undulatus 18 NA NA
Caranx melampygus 15 6 Sudekum et al, 1991 (Article)
Centropyge bispinosa 11 NA NA
Centropyge flavissima 27 NA NA
Cephalopholis argus 21 39 Mapleston et al, 2009 (Report)
Cephalopholis urodeta 17 12 Payet et al, 2016 (Article)
Chaetodon citrinellus 6 7 Berumen et al, 2005 (Article)
Chaetodon ornatissimus 10 NA NA
Cheilinus chlorourus 6 NA NA
Chlorurus spilurus 16 11 DeMartini et al, 2017 (Article)
Chromis iomelas 5 NA NA
Chromis viridis 9 NA NA
Ctenochaetus marginatus 13 NA NA
Ctenochaetus striatus 17 37 Trip et al, 2008 (Article)
Dascyllus aruanus 7 NA NA
Dascyllus flavicaudus 13 NA NA
Epibulus insidiator 16 16 Hubble, 2003 (PhD Thesis)
Epinephelus fasciatus 13 21 Mapleston et al, 2009 (Report)
Epinephelus hexagonatus 14 NA NA
Epinephelus merra 17 6 Pothin et al, 2004 (Article)
Epinephelus merra 17 6 Moore et al, 2013a (Report)
Epinephelus polyphekadion 20 44 Mapleston et al, 2009 (Report)
Gnathodentex aureolineatus 17 NA NA
Gymnosarda unicolor 7 NA NA
Halichoeres trimaculatus 5 NA NA
Lutjanus fulvus 21 34 Shimose and Nanami, 2014 (Article)
Lutjanus gibbus 1 38 Moore, 2019 (Article)
Lutjanus kasmira 30 6 Moore et al, 2013a (Report)
Lutjanus kasmira 30 6 Moore et al, 2013a (Report)
Monotaxis grandoculis 20 NA NA
Mulloidichthys flavolineatus 6 6 Mehanna et al, 2017 (Article)
Myripristis berndti 24 NA NA
Naso lituratus 10 20 Moore et al, 2013a (Report)
Naso lituratus 10 20 Moore et al, 2013a (Report)
Naso lituratus 10 20 Moore et al, 2013b (Report)
Naso lituratus 10 20 Moore et al, 2013b (Report)
Naso unicornis 17 50 Andrews et al, 2016 (Article)
Odonus niger 16 NA NA
Ostorhinchus angustatus 6 NA NA
Ostorhinchus apogonoides 7 NA NA
Parupeneus barberinus 6 NA NA
Plectropomus laevis 22 16 Heupel et al, 2010a (Article)
Pristiapogon taeniopterus 8 NA NA
Sargocentron microstoma 13 NA NA
Scarus psittacus 6 6 DeMartini et al, 2017 (Article)
Scarus psittacus 6 6 Taylor and Choat, 2014 (Article)
Siganus argenteus 13 NA NA
Siganus spinus 3 NA NA
Stegastes albifasciatus 8 NA NA
Stegastes nigricans 13 NA NA
Zebrasoma scopas 24 NA NA

5. Annex

Reproducibility

# 1. Reproducibility ----

sessionInfo()
## R version 4.0.1 (2020-06-06)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 18363)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252   
## [3] LC_MONETARY=French_France.1252 LC_NUMERIC=C                  
## [5] LC_TIME=French_France.1252    
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] rfishbase_3.0.4     plotly_4.9.2.1      readxl_1.3.1       
##  [4] formattable_0.2.0.1 kableExtra_1.1.0    forcats_0.5.0      
##  [7] stringr_1.4.0       dplyr_1.0.0         purrr_0.3.4        
## [10] readr_1.3.1         tidyr_1.1.0         tibble_3.0.1       
## [13] ggplot2_3.3.2       tidyverse_1.3.0     extrafont_0.17     
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.4.6      lubridate_1.7.9   lattice_0.20-41   assertthat_0.2.1 
##  [5] digest_0.6.25     R6_2.4.1          cellranger_1.1.0  backports_1.1.7  
##  [9] reprex_0.3.0      evaluate_0.14     highr_0.8         httr_1.4.1       
## [13] pillar_1.4.4      rlang_0.4.6       curl_4.3          lazyeval_0.2.2   
## [17] data.table_1.12.8 rstudioapi_0.11   extrafontdb_1.0   blob_1.2.1       
## [21] rmarkdown_2.3     labeling_0.3      webshot_0.5.2     htmlwidgets_1.5.1
## [25] munsell_0.5.0     broom_0.5.6       compiler_4.0.1    modelr_0.1.8     
## [29] xfun_0.14         pkgconfig_2.0.3   htmltools_0.5.0   tidyselect_1.1.0 
## [33] fansi_0.4.1       viridisLite_0.3.0 crayon_1.3.4      dbplyr_1.4.4     
## [37] withr_2.2.0       grid_4.0.1        nlme_3.1-148      jsonlite_1.6.1   
## [41] Rttf2pt1_1.3.8    gtable_0.3.0      lifecycle_0.2.0   DBI_1.1.0        
## [45] magrittr_1.5      scales_1.1.1      cli_2.0.2         stringi_1.4.6    
## [49] farver_2.0.3      fs_1.4.1          xml2_1.3.2        ellipsis_0.3.1   
## [53] generics_0.0.2    vctrs_0.3.1       gh_1.1.0          tools_4.0.1      
## [57] glue_1.4.1        crosstalk_1.1.0.1 hms_0.5.3         yaml_2.2.1       
## [61] colorspace_1.4-1  rvest_0.3.5       memoise_1.1.0     knitr_1.28       
## [65] haven_2.3.1

Jeremy WICQUART | | 2020-07-26 09:46:45